<?php
//include object for MySQL
	include_once('../../configs/configs.php');
	include_once('../../connect/DBAccess.php');
	include_once('../../model/usermodel.php');
	 $sql = 'set names "utf8"';
        @ mysql_query($sql);
	if(isset($_POST['action']) && $_POST['action']=='checkUser')
	{
		$username = $_POST['username'];
		if($username!='')
		{
			$rs = checkUser($username);
			if($rs)
				echo 1;
			else echo 0;
		}		
		else echo 3;
	}
	if(isset($_POST['action']) && $_POST['action']=='checkemail')
	{
		$email = $_POST['email'];
		if($email!='')
		{
			$rs = checkemail($email);
			if($rs)
				echo 1;
			else echo 0;
		}		
		else echo 3;
	}
	if(isset($_POST['action']) && $_POST['action']=='checkcmnd')
	{
		$cmnd = $_POST['cmnd'];
		if($cmnd!='')
		{
			$rs = checkcmnd($cmnd);
			if($rs)
				echo 1;
			else echo 0;
		}		
		else echo 3;
	}
?>